﻿<DockPanel x:Class="HappyBa.Components.DetailsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:HappyBa.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:components="clr-namespace:HappyBa.Components"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <StackPanel DockPanel.Dock="Right" Width="140" >
        <Grid>
           <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Column="0">
                <Label Content="{loc:Tr Effort}" Margin="0" Padding="0"/>
                <TextBox Text="{Binding Effort}" IsReadOnly="True" IsReadOnlyCaretVisible="True" Margin="2"/>
            </StackPanel>
            <StackPanel Grid.Column="1">
                <Label Content="{loc:Tr TimeSpent}" Margin="0" Padding="0"/>
                <TextBox Text="{Binding TimeSpent}" IsReadOnly="True" IsReadOnlyCaretVisible="True" Margin="2"/>
            </StackPanel>
        </Grid>
        <Label Content="{loc:Tr State}" Margin="0" Padding="0"/>
        <TextBox Text="{Binding EntityState.Name}" IsReadOnly="True" IsReadOnlyCaretVisible="True" Margin="2"/>
        <Label Content="{loc:Tr Owner}" Margin="0" Padding="0"/>
        <TextBox IsReadOnly="True" IsReadOnlyCaretVisible="True" Margin="2">
            <MultiBinding StringFormat="{}{0} {1}">
                <Binding Path="Owner.FirstName" />
                <Binding Path="Owner.LastName" />
            </MultiBinding>
        </TextBox>
        <Label Content="{loc:Tr Impediments}" Margin="0" Padding="0"/>
        <ListBox ItemsSource="{Binding Impediments}"/>
        <Label Content="{loc:Tr Assignments}" Margin="0" Padding="0"/>
        <ListBox ItemsSource="{Binding Assignments}"/>
    </StackPanel>
    <DockPanel DockPanel.Dock="Top">
        <TextBox Text="{Binding Id}" MinWidth="64" IsReadOnly="True" IsReadOnlyCaretVisible="True" DockPanel.Dock="Left" Margin="2"/>
        <TextBox Text="{Binding Priority.Name}" MinWidth="56" IsReadOnly="True" IsReadOnlyCaretVisible="True" Margin="2" DockPanel.Dock="Right"/>
        <TextBox Text="{Binding Name}" IsReadOnly="True" IsReadOnlyCaretVisible="True" DockPanel.Dock="Right" Margin="2"/>
    </DockPanel>
    <TabControl>
        <TabItem Header="{loc:Tr Description}">
            <components:DescriptionView Value="{Binding Description}"  Margin="2"/>
        </TabItem>
        <TabItem Header="{loc:Tr Comments}">
            <components:DescriptionView x:Name="Comments"  Margin="2"/>
        </TabItem>
    </TabControl>
</DockPanel>
